import log from '@/assets/image/log.png'

// 图片url过滤器
export const pathFilter = (url) => {
    if(url) return "http://chenziyu.xyz:8000/" + url.split("net/")[1];
    else return log
};

// 时间格式过滤器
export const dateFilter = (originVal) => {
  const dt = new Date(originVal)
  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  const d = (dt.getDate() + '').padStart(2, '0')
  // const hh = (dt.getHours() + '').padStart(2, '0')
  // const mm = (dt.getMinutes() + '').padStart(2, '0')
  // const ss = (dt.getSeconds() + '').padStart(2, '0')
  // return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
  return `${y}-${m}-${d}`
};